package com.xinongbest.oa.dao;

import com.xinongbest.oa.entity.LeaveForm;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @author lemonwan
 */
public interface LeaveFormDao {
    /**
     * <h2>增加请假数据</h2>
     *
     * @param form
     */
    void insert(LeaveForm form);

    /**
     * <h2>查询待审批的任务：流程状态（adm_process_flow.state）是 process且
     * 操作人（adm_process_flow.operator_id）是当前登录用户的</h2>
     *
     * @param processState
     * @param operatorId
     * @return
     */
    List<Map<String, Object>> selectByParam(@Param("process_state") String processState, @Param("operator_id") Long operatorId);

    /**
     * <h2>更新请假单状态</h2>
     *
     * @param leaveForm
     */
    void update(LeaveForm leaveForm);

    /**
     * 通过ID查询请假单
     *
     * @param formId
     * @return
     */
    LeaveForm selectById(Long formId);
}
